fix: Make _redrawMenu() append/pop hot items according to sensor pref…#569
Open
ner216 wants to merge 1 commit into
Open
fix: Make _redrawMenu() append/pop hot items according to sensor pref…#569ner216 wants to merge 1 commit into
ner216 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem:
When you disable a sensor such as 'Monitor Memory' in the extension preferences when you have a top bar icon showing that metric (hot item); the hot item will stay in the top bar with no way to remove it. The only way to remove it is to re-enable the sensor and then toggle off the hot item.
Example:

Solution:
I added logic to the '_redrawMenu()' method to check if a sensor group is enabled and update the array of hot sensors accordingly. I also added a gsettings signal to call _redrawMenu() every time a sensor group setting is toggled. Now, when a sensor group like "Monitor Memory" is disabled, the selected hot item will also disappear.
Example:
